package com.example.gyt.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yaml.snakeyaml.constructor.BaseConstructor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class CommunalController extends BaseConstructor {

    @RequestMapping(value = "/register")
    public String register(){
        return "register";
    }

    @RequestMapping(value = "/login")
    public String login(){
        return "login";
    }

    @RequestMapping(value = "/forgetPassword")
    public String forgetPassword(){
        return "forgetPassword";
    }


    @RequestMapping(value = "/admin")
    public String admin(HttpServletRequest request){
        try {
            HttpSession session = request.getSession(true);
            session.setAttribute("user_leve", "1");
        }catch (Exception e) {
            e.printStackTrace();
        }
        return "admin";
    }

    @RequestMapping(value = "/assistance")
    public String assistance(){
        return "assistance";
    }

    @RequestMapping(value = "/personalData")
    public String personalData(){
        return "personalData";
    }

    @RequestMapping(value = "/changePassword")
    public String changePassword(){
        return "changePassword";
    }

    @RequestMapping(value = "/addUsers")
    public String addUsers(){
        return "addUsers";
    }

    @RequestMapping(value = "/adminUpdateUsers")
    public String adminUpdateUsers(){
        return "adminUpdateUsers";
    }

    @RequestMapping(value = "/adminStrationManagement")
    public String adminStrationManagement(){
        return "adminStrationManagement";
    }

    @RequestMapping(value = "/landManagement")
    public String landManagement(){
        return "landManagement";
    }

    @RequestMapping(value = "/merchandiseManagement")
    public String merchandiseManagement(){
        return "merchandiseManagement";
    }

    @RequestMapping(value = "/orderManagement")
    public String orderManagement(){
        return "orderManagement";
    }

    @RequestMapping(value = "/landLeaseManagement")
    public String landLeaseManagement(){
        return "landLeaseManagement";
    }

    @RequestMapping(value = "/landInformationManagement")
    public String landInformationManagement(){
        return "landInformationManagement";
    }

    @RequestMapping(value = "/messageManagement")
    public String messageManagement(){
        return "messageManagement";
    }

    @RequestMapping(value = "/addLand")
    public String addLand(){
        return "addLand";
    }

    @RequestMapping(value = "/adminLatestNews")
    public String adminLatestNews(){
        return "adminLatestNews";
    }

}
